{% extends "recursosHumanos/index.html" %}
{% load i18n %}
{% block title %}{% trans 'Página da Lista Docentes Recursos Humanos'%}{% endblock %}

{% block breadcrumb %}
<ul class="breadcrumb">
	<li>
		<span class="glyphicon glyphicon-home"></span> <a tabindex="2" href="{% url homeRecursosHumanos %}" title="{% trans 'Home' %}">{% trans 'Home' %}</a>
	</li>
	<li class="active">{% trans 'Lista de Docentes' %}</li>
</ul>
{% endblock %}

<!-- Estes blocos é para alterar a classe do menu do index, refere se está ou não activo -->
{% block MenuDocente %}active{% endblock %}
{% block MenuInformacao %} {% endblock %}

{% block filtros %}
<div class="list-group">
  <a href="#" class="list-group-item active">
    Departamento
  </a>
  {% include "recursosHumanos/elements/filter_dep.html" %}
  
  <a href="#" class="list-group-item active">Categoria</a>
  {% include "recursosHumanos/elements/filter_cat.html" %}

</div>
<!--<ul>

	<li class='title'>
		<span>Filtros</span>
	</li>
	<li class="has-sub" >
		<a  id="oa_button" tabindex="4" href='#oa'><span>Por Ordem Alfabética</span></a>

	</li>
	<div id="oa">

	

	</div>

	<li class="has-sub">
		<a id="da_button" tabindex="4" href='#dep'><span>Por Departamento</span></a>
		
	</li>
	<div id="dep">

	

	</div>
	<li class="has-sub">
		<a id="ca_button" tabindex="4" href='#category'><span>Por Categoria</span></a>
		
	</li>
	<div id="category">

	

	</div>
</ul>

  <ul class="box_filter" role="menu" aria-labelledby="dropdownMenu2">
    <li role="presentation" class="dropdown-header"><a role="dropdown-header" tabindex="-1" href="#">Dropdown header</a></li>
    <li role="presentation" class="dropdown-header"><a role="menuitem" tabindex="-1" href="#">Another action</a></li>
    <li role="presentation" class="dropdown-header"><a role="menuitem" tabindex="-1" href="#">Something else here</a></li>
    <li role="presentation" class="divider"></li>
    <li role="presentation" class="dropdown-header"><a role="menuitem" tabindex="-1" href="#">Separated link</a></li>
  </ul>-->
  



{% endblock %}

{% block content %}
<div class="page-header whiteText">
  <h1>{% trans 'Lista de Docentes '%}</h1>
</div>

	<form id= "form_report" method="post" action ="{%url print_pdf %}" role="form">
		{% csrf_token %}
		<input id = "hidden_inputDados" name ="table_json" type="hidden"/>
		<input id = "dados_report" value ="{%trans 'Lista de Docentes'%}" name ="tituloReport" type="hidden"/>
		<input id = "ano_report" value ="{{anoActual}}" name ="ano" type="hidden"/>
		<input id = "user_report" value ="{{user.first_name}} {{user.last_name}}" name ="user_name" type="hidden"/>
		<input id = "tipoReport" value ="0" name ="tipoReport" type="hidden"/>
		<input id="button_print" value ="{%trans 'Imprimir'%}" type="button" class="btn btn-primary"/>
	</form><br>

{%comment%}
<nav role="navigation" class="navbar navbar-default">
	<div  class="collapse navbar-collapse">
       	<div  class="collapse navbar-collapse navbar-left" >
       		{% if keyword != None%}	
          		<p class="navbar-text">Pesquisa por "{{keyword}}</p>
          	{% endif %}
          	<p class="navbar-text">{{sizeList}} resultados encontrados</p>
        </div>
        {% csrf_token %}
        <form role="search" class="navbar-form navbar-left" action="" method="get" name="searchForm">
        	<div class="form-group">
           		<input name="searchField" type="text" placeholder="{%trans 'Search'%}" class="form-control" value="{{keyword}}">
            </div>
            <button class="btn btn-default" name="Submit" type="submit">{%trans 'Search'%}</button>
       	</form>
	</div>
</nav>
{%endcomment%}


<table cellpadding="0" cellspacing="0" border="0" class="display sumary_table" id="special_table" width="100%">
<thead>	
	<tr>
		<th class="cabecalho_sumario">Docente</th>
		<th class="cabecalho_sumario">Departamento</th>
		<th class="cabecalho_sumario">Categoria</th>
		<th class="cabecalho_sumario">Regime Exclusividade</th>
		<th class="cabecalho_sumario">Termo Contrato</th>
	</tr>
</thead>
<tbody>
	{% for nome, departamento, id_Docente, nomeCategoria, exclusividade, fim_contrato in listaDocentes %}
		<tr>
			<td class="teacher_name_field"><a href="{{id_Docente}}">{{nome}}</a></td>
			<td>{{departamento}}</td>
			<td>{{nomeCategoria}}</td>
			
			<td>{{exclusividade}}</td>
		
			<td>{{fim_contrato}}</td>
		</tr>
	{% endfor %}
</tbody>
</table>

<!--<div class="clearfix"></div>-->


<!--<div id="paginator">
<a href="#">1</a>
<a href="#">Mostrar Todos</a>
</div>-->
<!--<div id="paginator">
<span class="step-links">
{% if docentes.has_previous %}
<a href="?page={{ docentes.previous_page_number }}">anterior</a>
{% endif %}

<span class="current">
Página {{ docentes.number }} de {{ docentes.paginator.num_pages }}.
</span>

{% if docentes.has_next %}
<a href="?page={{ docentes.next_page_number }}">seguinte</a>
{% endif %}
</span>
</div>-->

<!--PAGINAÇÂO -->

{%comment%}
<div>
	

		<span class="current"> Página {{ docentes.number }} de {{ docentes.paginator.num_pages }}. </span>
		<span class="step-links"><a href="?show=all">Todos</a></span>
	
	<ul class="pagination">	
		<li><a href="?show=all">Todos</a></li>
		{% for page_num in drange %}
			{%if page_num == docentes.number%}
				<li id = "{{ page_num}}" class="active"><a href="?page={{ page_num}}&{{actualState}}">{{ page_num}}</a></li>
			{%else%}
				 <li id = "{{ page_num}}"><a href="?page={{ page_num}}&{{actualState}}">{{ page_num}}</a></li>
			{%endif%}
		{% endfor%} 
	</span>	
</div>
{%endcomment%}





<script type="text/javascript">
	$(document).ready(function() {
		$('#special_table').dataTable({
			"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
			"oLanguage": {
	            "sUrl": "/static/dataTables/lang/pt-pt.txt"
	        },
	         "sPaginationType": "full_numbers",
	         "sDom": '<"dataTables_special_bar"l><"dataTables_special_bar"if><"whiteBox"rt><"pagination_box"p>'
	        
	        	
		});
		$('.hasTooltip').tooltip({"container": false});
		
		$("#button_print").click(function(){
			var table = $('#special_table').tableToJSON();
			var dados_tableStr = JSON.stringify(table);
			
			$("#hidden_inputDados").val(dados_tableStr);
			$("#form_report").submit();
		});
		
	} );
</script>
{% endblock %}